package com.job.sun.HomeWork0712;

import java.awt.*;
import java.util.Scanner;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-12 18:22:44
 */
public class TestTiger {
    public static void main(String[] args) {
        Tiger tiger = new Tiger();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入老虎的攻击方式:1.扑 2.掀 3.剪");
        String anstr = sc.next();

        while (!anstr.equals("exit")) {
            tiger.attack = ChoiceAttack.choice(anstr);
            if (tiger.attack != null) {


                tiger.Attack();
            } else {
                Attack t = new Attack() {

                    @Override
                    public void attack() {
                        System.out.println("老虎摆烂,不攻击");
                    }
                };
                t.attack();
            }
            anstr = sc.next();
        }

    }
}
